import Vue from 'vue';
import App from './app.vue';
import sdk from './sdk';

import '@/assets/style/base.css';
import '@/assets/style/style.less';
import '@/assets/icon/tabbar_home.png';

import vant from '@/vue-plugins/vant.js';

import toast from '@/components/common/toast/index';

import bus from '@/utils/bus';

Vue.use(vant);
Vue.use(toast);

function runApp() {
	Vue.prototype.$cloud = wf.getModule('cloud');
	Vue.prototype.$cloudApi = wf.getModule('cloudApi');
	Vue.prototype.$reporter = wf.getModule('reporter');
	Vue.prototype.$report = wf.getModule('reporter').report;
	Vue.prototype.$bus = bus;
	return new Vue({
		render: (h) => h(App),
		router: wf.getModule('router'),
		store: wf.getModule('store'),

		created() {
			this.$report('default', 'creatApp', {});
		},

		mounted() {
			this.$report('default', 'mountApp', {});
		},
	}).$mount('#app');
}

sdk().then(runApp());
